1. Field of the Invention
The present invention relates to a data processing method employed when messages are exchanged between objects. The invention also relates to a recording medium on which an operating system implementing the above data processing method is recorded, and to a data processing apparatus provided with the above recording medium.
2. Description of the Related Art
Along with recent advances in software programming techniques, the development of software based on the object-oriented technique is progressing. When the object-oriented technique is applied to software, the functions of the software, such as application programs, can be formed into modules by objects. By exchanging the required information with each other as messages, the objects fulfill their functions as modules. Such message exchanges are referred to as xe2x80x9cmessage passingxe2x80x9d.
As a method for implementing message passing, various techniques have been proposed and have been put into practical use. One of the techniques is xe2x80x9cfuturexe2x80x9d-based message passing. The basic operation of future-based message passing is shown in FIG. 1. In FIG. 1, a message sending object is shown as a client object, while a message receiving object is shown as a server object.
In future-based message passing, a message is sent from a client object to a server object, as represented by the arrow B1 in FIG. 1, to request the server object to perform predetermined processing. At this time, a data area for storing the result of the processing executed by the server object is reserved. The data area is an area for storing the result to be received by the client object, and is referred to as a xe2x80x9cfuturexe2x80x9d.
The server object executes processing, as indicated by the solid line B2 in FIG. 1, in accordance with the request of the message sent from the client object. When the processing is completed, the server object stores the processing result in the future, as represented by the arrow B3 in FIG. 1.
Meanwhile, the client object continues processing, as indicated by the solid line B4 in FIG. 1, after sending the above message to the server object. Thereafter, when the client object requires the result of the processing performed by the server object, it reads the data stored in the future, as represented by the arrow B5 in FIG. 1.
At this time, if the result of the processing executed by the server object has not yet been stored in the future, the client object is in a waiting state, as represented by the single-dot-chain line B6 in FIG. 1. When the processing result sent from the server object is stored in the future, it is delivered to the client object from the future, as represented by the arrow B7 in FIG. 1.
That is, if the result of the processing executed by the server object is stored in the future, the client object immediately receives the processing result. If, however, the result of the processing performed by the server object has not yet been stored in the future, the client object remains in the waiting state before the result is stored in the future.
In future-based message passing, such as the one illustrated in FIG. 1, a situation frequently arises in which the client object is required to wait for the result of the processing executed by the server object after sending a message to the server object.
The above-described situation may occur not only when the processing of the server object has not yet been completed, but also when for example, an error occurs interrupting the normal execution of the server object. The above-described situation may also occur when message passing is unable to operate due to a breakdown of a communication channel, such as a network, required for message passing.
If the object cannot exit from the waiting state, it appears to the user that a system built into, for example, a set top box, has stopped for an unknown reason.
Accordingly, it is desirable that an operating system providing a function of future-based message passing be able to resume processing of an object even when the object enters the waiting state due to some problem, so that software running on the operating system is stably operated.
In the conventional operating system, with the occurrence of a waiting state, time-out processing is often executed regardless of the reason of the occurrence of a waiting-state in order to discontinue the above state. In this method, however, the waiting state continues until the time-out processing is started, thereby wasting time depending on the period set for starting the time-out processing. Additionally, even if the waiting state is discontinued by the time-out processing, the reason for the occurrence of the waiting state cannot be specified, which may further cause the occurrence of another waiting state.
In view of the above background of the conventional art, it is an object of the present invention to provide a data processing method in which even if an object enters a waiting state due to some problem while future-based message passing is being performed, the object can exit from the waiting state without needing to execute time-out processing.
It is another object of the present invention to provide a recording medium on which an operating system implementing the above-described data processing method is recorded, and to provide a data processing apparatus provided with such a recording medium.
In order to achieve the above object, according to one aspect of the present invention, there is provided a data processing method in which a message is sent from a client object to a server object, and the server object executes processing in response to a request by the message and returns a result of the processing to the client object. In this method, when a message is sent from the client object to the server object, an area for storing result data indicating the result of the processing executed by the server object, and an area for storing status data indicating a status of the server object are reserved. If the processing executed by the server object has been correctly completed, the result data is stored in the data area. If the processing executed by the server object has not been correctly completed, the status data is stored in the data area. By reading the data stored in the data area, the client object receives the result data if the processing executed by the server object has been correctly completed. If the processing executed by the server object has not been correctly completed, the client object receives the status data.
According to the aforementioned data processing method, if the processing executed by the server object has not been correctly completed, the status data indicating the status of the server object is delivered to the client object via the above-described data area. Thus, even if the client object enters the waiting state due to some problem while message passing is being performed, the status of the server object can be known by to the client object without needing to execute time-out processing, thereby enabling the client object to exit from the waiting state.
According to another aspect of the present invention, there is provided a recording medium on which an operating system is recorded. The operating system comprises message sending means, as an application program interface for describing an object, for sending to another object a message that requests it to perform processing and to return a result of the processing. The aforementioned operating system sends a message from a client object to a server object in accordance with the message-sending means, and reserves a data area including a portion for storing result data indicating a result of processing executed by the server object and a portion for storing status data indicating a status of the server object. The operating system further stores the result data in the data area if the processing executed by the server object has been correctly completed. The operating system stores the status data in the data area if the processing executed by the server object has not been correctly completed.
The operating system recorded on the recording medium stores the status data indicating the status of the server object in the above-described data area if the processing executed by the server object has not been correctly completed. Accordingly, by reading the data stored in the data area, the client object is able to receive the status data. Thus, even if the client object enters the waiting state due to some problem while message passing is being performed, the status of the server object can be known by the client object without needing to execute time-out processing, thereby enabling the client object to exit from the waiting state.
According to a further aspect of the present invention, there is provided a data processing apparatus comprising a recording medium on which an operating system is recorded. The operating system comprises message-sending means, as an application program interface for describing an object, for sending to another object a message that requests it to perform processing and to return a result of the processing. The aforementioned operating system sends a message from a client object to a server object in accordance with the message-sending means, and reserves a data area including a portion for storing result data indicating a result of processing executed by the server object and a portion for storing status data indicating a status of the server object. The operating system stores the result data in the data area if the processing executed by the server object has been correctly completed. The operating system stores the status data in the data area if the processing executed by the server object has not been correctly completed.
The operating system recorded on the recording medium provided with the data processing apparatus stores the status data of the server object in the above-described data area if the processing executed by the server object has not been correctly completed. Accordingly, by reading the data stored in the data area, the client object is able to receive the status data. Thus, even if the client object enters the waiting state due to some problem while message passing is being performed, the status of the server object can be known by to the client object without needing to execute time-out processing, thereby enabling the client object to exit from the waiting state.
In this specification, software for managing the execution of application programs is referred to as xe2x80x9can operating systemxe2x80x9d in a broad sense. That is, the operating system described in this specification includes not only basic software for managing hardware, but also, software operating on basic software for managing hardware and managing the execution of application programs, which is referred to as, xe2x80x9cmiddlewarexe2x80x9d. Further, the operating system described in this specification includes software implementing a virtual computer system, in which a plurality of program execution environments are implemented by a single computer, and it appears to the user that a plurality of computers were operating.